+2006-09-24 Kristian Rietveld <kris@gtk.org>
+
+ * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_update_button): draw
+ the indicator if the column has a sort column id (and the model is
+ sortable) or if the user explicitly requested the indicator
+ to be shown. (Fixes #352738, Chris Vine).
+
2006-09-23 Tor Lillqvist <tml@novell.com>
* gtk/Makefile.am: Use EXEEXT.
static void
gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column)
{
- gint sort_column_id;
+ gint sort_column_id = -1;
GtkWidget *hbox;
GtkWidget *alignment;
GtkWidget *arrow;
"");
}
- if (GTK_IS_TREE_SORTABLE (model)
- && gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (model),
- &sort_column_id,
- NULL))
+ if (GTK_IS_TREE_SORTABLE (model))
+ gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (model),
+ &sort_column_id,
+ NULL);
+
+ if (tree_column->show_sort_indicator
+ || (sort_column_id >= 0 && sort_column_id == tree_column->sort_column_id))
{
- if (sort_column_id == tree_column->sort_column_id)
- {
- switch (tree_column->sort_order)
- {
- case GTK_SORT_ASCENDING:
- arrow_type = GTK_ARROW_DOWN;
- break;
+ switch (tree_column->sort_order)
+ {
+ case GTK_SORT_ASCENDING:
+ arrow_type = GTK_ARROW_DOWN;
+ break;
- case GTK_SORT_DESCENDING:
- arrow_type = GTK_ARROW_UP;
- break;
-
- default:
- g_warning (G_STRLOC": bad sort order");
- break;
- }
+ case GTK_SORT_DESCENDING:
+ arrow_type = GTK_ARROW_UP;
+ break;
+
+ default:
+ g_warning (G_STRLOC": bad sort order");
+ break;
}
}
}
g_object_unref (arrow);
- if (GTK_IS_TREE_SORTABLE (model) && tree_column->sort_column_id >= 0)
+ if (tree_column->show_sort_indicator
+ || (GTK_IS_TREE_SORTABLE (model) && tree_column->sort_column_id >= 0))
gtk_widget_show (arrow);
else
gtk_widget_hide (arrow);